src = $(wildcard *.c)
cobjs=$(patsubst %.c, %.o, $(src))
targets = $(patsubst %.c, %, $(src))

CC = gcc
CFLAGS = -Wall -g -I../../
.PHONY:clean all build_client build_server


all:build_client build_server

build_client:wrap.o client.o
	$(CC) $^ -o client $(CFLAGS) -lm -lrt  -lpthread

build_server: server.o wrap.o 
	$(CC) $^ -o server $(CFLAGS)


clean:
	-rm -rf $(cobjs) $(targets) 
test:
	@echo cobjs=$(cobjs)
	@echo targets=$(targets)